﻿using System;

namespace _1486_xor_operation_in_an_array
{
    class Program
    {
        static void Main (string[] args)
        {
            Console.WriteLine (XorOperation(5, 0));


        }

        public static int XorOperation (int n, int start)
        {
            int num = start;
            for (int i = 1;i < n;i++)
            {
                num ^= start + i * 2;
            }
            return num;
        }
    }
}
